package com.gitee.webmagic.controller;

import com.gitee.webmagic.manager.CrawlerManager;
import com.gitee.webmagic.processor.BlogPageProcessor;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.downloader.HttpClientDownloader;

/**
 * @author wangqiang
 * @version 1.0
 * @date 2021/3/24 22:38
 */
@RestController
@AllArgsConstructor
public class BlogController {

    private final CrawlerManager crawlerManager;

    @RequestMapping("/acquire")
    public String acquireData() {
        crawlerManager.execute();
        return "success";
    }
}
